import request from '@/utils/request'

// 添加角色
export function addRoleApi(params = {}) {
  return request.post('/system/sysRole', params)
}

// 修改角色
export function modifyRoleApi(params = {}) {
  return request.put('/system/sysRole', params)
}

// 查询角色
export function getRoleByParamApi(params = {}) {
  return request.get('/system/sysRole/get', { params })
}

// 查询角色
export function getRoleListApi(params = {}) {
  return request.get('/system/sysRole/page', { params })
}

// 删除角色
export function deleteRoleApi(params) {
  return request.delete(`/system/sysRole/${params.id}`)
}

// 批量删除
export function deleteRolesApi(params) {
  return request.delete('/system/sysRole/delete', {
    data: params
  })
}

// 导出角色
export function exportRoleApi(params) {
  return request.post('/system/sysRole/export', params, { responseType: 'blob' })
}
